#pragma once

#ifndef YETIENEMY_H
#define YETIENEMY_H

#include "Entity.h"
#include "StateMachine.h"
#include "Particle.h"
#include "Gravity.h"
#include "Drag.h"
#include "DecisionTreeNode.h"
#include "Level.h"
#include "LevelManager.h"
#include "Collision.h"
#include "Contact.h"
#include "ForceRegistry.h"
#include "ForceGenerator.h"
#include "AnimationPlayer.h"

class YetiEnemy : public Entity
{
public:
	bool flip;	
	int health;
	AnimationPlayer* yetiAnims;
	D3DXVECTOR3 direction;
	Particle particle;
	StateMachine<YetiEnemy> stateMachine;
	DecisionTreeNode<YetiEnemy>* decisionTree;
private:
	float elapsedTime;
	Level* level;
	Entity* player;
	Drag drag;
	Gravity gravity;
public:
	YetiEnemy(AnimationPlayer* yetiAnims, D3DXVECTOR3 position, Level* level);
	//set method update the particles position
    virtual void setPosition(D3DXVECTOR3 newPosition)
	{
		position = newPosition;
		particle.position = newPosition;
	}
	IDirect3DTexture9* getTexture()
	{
		return yetiAnims->getCurrentAnimation()->getTexture();
	}
	int getHealth() { return health; }
	~YetiEnemy() { delete yetiAnims; }
	void update(float frameTime);
	void draw(ID3DXSprite* sprite);
	void handleMessage(Message message);
};

#endif